import pythreadlock
import time
import threading
g="3"
a=pythreadlock.threadlock("3");
d=time.perf_counter_ns()
numlock=threading.Lock()
num=1
def b():
    a.get()
    global num
    numlock.acquire()
    num=num+1
    numlock.release()
for i in range(10000):
     c=threading.Thread(target=b)
     c.start()
while(num<10000):
     continue
print(time.perf_counter_ns()-d)
num=1
testlock=threading.Lock()
d=time.perf_counter_ns()
def b():
    global num
    testlock.acquire()
    h=g
    testlock.release()
    numlock.acquire()
    num=num+1
    numlock.release()
for i in range(10000):
     c=threading.Thread(target=b)
     c.start()
while(num<10000):
     continue
print(time.perf_counter_ns()-d)